<?php
/**
 * Created by PhpStorm.
 * User: ASUS
 * Date: 2018/8/27
 * Time: 11:19
 */

namespace app\admin\validate\admin;


use think\Validate;

class Admin extends Validate
{
    protected $rule=[
        'admin_name'=>'require|length:4,20|unique:admin',
        'admin_password'=>'require|length:6,100',
        'admin_repassword'=>'require|confirm:admin_password',
        'admin_email'=>'require|email|unique:admin',
    ];
    protected $message=[
        'admin_name.require'=>'用户名必填',
        'admin_name.unique'=>'用户名不能重复',
        'admin_name.length'=>'用户名长度错误,4-20',
        'admin_password'=>'用户密码错误',
        'admin_repassword'=>'2次密码不一致',
        'admin_email.require'=>'邮箱必填',
        'admin_email.unique'=>'邮箱重复',
        'admin_email.email'=>'邮箱地址不正确'
    ];
//    protected $scene=['add','edit'];
}